//
// Created by Administrator on 2020/10/14.
//

#ifndef O5G_SRC_O5GRAN_INCLUDE_RANDEF_H_
#define O5G_SRC_O5GRAN_INCLUDE_RANDEF_H_

#include "../../../lib/csp/include/cspApi.h"
#include "../../ccore/misc/include/misc.h"
#include "../../ccore/include/commDef.h"
#include "../../ccore/include/o5g3gppTypes.h"
#include "../../ccore/include/o5g3gppConv.h"
#include "../../ccore/tables/include/tables.h"

typedef struct RanUeContext
{
    uint32_t ueId;
    uint32_t inUse;
    uint32_t nbIdx;
    uint32_t cellIdx;
    uint32_t ueIdx;

    /* TOML配置开始 */
    /* TOML配置结束 */
} S_RanUeContext;

typedef struct RanCellContext
{
    uint32_t nbIdx;
    uint32_t cellIdx;

    /* TOML配置开始 */
    uint32_t cellId;
    uint32_t inUse;
    uint16_t dlSubcarrierSpacing;
    /* TOML配置结束 */

    S_VarRingBuffer *pL2L1CpMsgQue;
    S_VarRingBuffer *pL1L2CpMsgQue;
    S_VarRingBuffer *pL2L1UpMsgQue;
    S_VarRingBuffer *pL1L2UpMsgQue;
    
    uint32_t ueNum;
    S_RanUeContext ueContext[RAN_UE_NUM_MAX];
} S_RanCellContext;

typedef struct RanNodeBContext
{
    uint32_t nbIdx;

    /* TOML配置开始 */
    uint32_t nbId;
    uint32_t inUse;
    S_O5gPlmnIdAdpt plmn;
    S_O5gIpStr amfIp;
    S_O5gIpStr upfIp;
    /* TOML配置结束 */

    uint32_t cellNum;
    S_RanCellContext cellContext[RAN_CELL_NUM_MAX];
} S_RanNodeBContext;

typedef struct RanContext
{
    E_AppType appType;
    uint32_t funcSplitOpt;
    char *configFilePath;

    /* TOML配置开始 */
    /* TOML配置结束 */

    uint32_t nbNum;
    S_RanNodeBContext nbContext[RAN_NODEB_NUM_MAX];
} S_RanContext;

extern S_RanContext* gpRanContext;

#endif //O5G_SRC_O5GRAN_INCLUDE_RANDEF_H_
